export default {
    state: {
        //空置菜单栏状态状态
        isCollapse: false,
        tabList: [ //面包屑
            {
                path: '/home',
                name: 'firstPage',
                menuName: '首页',
                icon: 's-home',
                url: 'firstPage'
            }
        ]
    },
    mutations: {
        collapseChange(state) {
            console.log("collapseChange ... ")
            state.isCollapse = !state.isCollapse;
        },
        menuChange: function (state, val) {
            console.log("menuChange ... ")
            //更改面包数据
            if (val.name !== 'main') {
                const index = state.tabList.findIndex(item => item.name === val.name);
                if (index === -1) {
                    state.tabList.push(val);
                }
            }
        },
        closeTag(state, val) {
            console.log("closeTag ... ")
            const index = state.tabList.findIndex(item => item.name === val.name)
            state.tabList.splice(index,1)
        }
    }
}
